<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-cn">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>收货管理</title>
		<%@ include file="/WEB-INF/views/modules/marketHeader.jsp"%>
		<link rel="stylesheet" type="text/css" href="${ctxStatic}/IDH/css/myAccount.css" />
		<link rel="stylesheet" type="text/css" href="${ctxStatic}/jq-address/css/select2.css" />
		<link rel="stylesheet" type="text/css" href="${ctxStatic}/jq-address/css/common.css" />
	</head>
	<style>
		label {
			font-weight: normal !important;
		}
		.form-group {
			height: 50px !important;
		}
		.form-control {
			background-color: #e2e2e2 !important;
			border-color: #e2e2e2 !important;
			box-shadow: none !important;
		}
		.form-control:focus {
			background-color: #fff !important;
			border-color: #28aac5 !important;
		}
		.name-tel .col-md-2 {
			width: 13% !important;
			margin-right: 1% !important;
			margin-left: 1.5% !important;
			text-align: left !important;
			padding: 0 !important;
		}
		.name-tel .col-md-4 {
			width: 33% !important;
			padding: 0 !important;
		} 
		.select2-container .select2-choice {
			height: 34px !important;
		    line-height: 34px !important;
		    background: #e2e2e2 border-box;
		    border-color: #e2e2e2 !important;
		}
		.select2-container .select2-choice .select2-arrow b{
		 	background-size: 60px 55px !important;
		}
		.select2-container .select2-choice .select2-arrow {
			border: 0;
    		background: #e2e2e2;
		}
		.loc-adress .col-md-4 {
			width: 31.6% !important;
			padding: 0 !important;
			margin-left: 1% !important;
		}
		.control-label {
			text-align: left !important;
		}
		.address-input .col-md-2 {
			width: 11% !important;
			margin-left: 1% !important;
			padding: 0 !important;
		}
		.address-input .col-md-10 {
			width: 86% !important;
			margin-left: 1% !important;
			padding: 0 !important;
		}
		.checkbox-address {
			margin-left: 1%;
			text-align: left;
			color: #808080;
		}
		.checkbox-address [type~=checkbox] {
			margin-right: 5px ;
		}
		.modal-footer {
			padding-top: 0 !important;
			text-align: center !important;
		}
		.modal-footer .btn {
			width: 33%;
		}
		.modal-footer .btn-default {
			margin-left: 10% !important;
		}
		.modal .modal-dialog .modal-content .modal-header {
			background: #fff !important;
			border: 0 !important;
		    height: 3em !important;
		    color: #000 !important;
		}
		.modal-title {
			position: absolute;
			left: 1em;
		}
		.p_add_address_btn .btn-primary{
			border-color: #28aac5 !important;
		    color: #fff !important;
		    background-color: #28aac5 !important;
		    width: 46%;
		}
		.p_add_address_btn .btn-default{
		    border-color: #28aac5;
		    color: #28aac5;
		    width: 46%;
		    font-family: "microsoft yahei";
		}
	</style>
	<body>
	
		
		
		<!--pc content start-->
		<!--模态框 开始-->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<h4 class="modal-title" id="myModalLabel">收货地址</h4>
					</div>
					<div class="modal-body">
						<form id="df" class="form-horizontal" action="${ctxf}/userfront/saveAddress" method="post">
							<input type="hidden" name="accountInfo.id" value="${user.id}" />
							<input type="hidden" name="id" id="addId" />
							<div class="form-group name-tel">
								<div class="col-md-12">
									<div class="control-label col-md-2">
										<label class="title-labal" for="title ">收货人:</label>
									</div>
									<div class="input-row col-md-4">
										<input type="text" id="pc_consignee" name="addUsername" class="form-control addUsername"autofocus>
									</div>
									<div class="control-label col-md-2">
										<label for="title">联系电话:</label>
									</div>
									<div class="input-row col-md-4">
										<input type="text" id="pc_contact_phone" name="addTelnum"  class="form-control p_contact_phone">
									</div>
								</div>
							</div>
							<div class="form-group loc-adress">
								<div class="col-md-12">
									<div class="col-md-4">
										<select onchange="getPrive()" id="loc_province"  name="loc_province">
										</select>
										<input style="position: absolute; z-index: -1;"  name="province" id="province"  />
									</div>
									<div class="col-md-4">
										<select onchange="getCity()" id="loc_city" name="loc_city">
										</select>
										<input style="position: absolute; z-index: -1;"  id="city" name="city" />
									</div>
									<div class="col-md-4">
										<select onchange="getTown()" id="loc_town" name="loc_town" >
										</select>
										<input style="position: absolute; z-index: -1;" id="countyTown" name="countyTown" />
									</div>
								</div>
							</div>
							<div class="form-group address-input">
								<div class="col-md-12">
									<div class="control-label col-md-2">
										<label for="title">详细地址</label>
									</div>
									<div class="col-md-10">
										<input type="text" id="detail" name="detail" class="form-control">
									</div>
								</div>
							</div>
							<div class="form-group">
								<div class="col-md-12">
									<div class="checkbox-address">
									    <input type="hidden" name="defAdd" id="ress" value="true"/>
									    <input type="checkbox" id="defaultAdd1"  name="defaultAdd" onclick="addressCheck()" />设为默认地址
									</div>
								</div>
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-primary" name="buttonName" id="buttonName">保存</button>
								<button type="button" class="btn btn-default" data-dismiss="modal" onclick="$('#addId').val('')">取消</button><br>
								<button type="submit" id="submitHidden" class="btn btn-primary" style='visibility: hidden;'>保存</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!--模态框 结束-->
		<section class="container content" id='container'>
			<div class="col-lg-10 col-xs-12">
				<div class="row">
					<ul class="nav nav-tabs" role="tablist" id="myTab">
						<li role="presentation">
							<a href="${ctxf}/userfront/myAccount.html" >我的账户</a>
						</li>
						<li role="presentation">
							<a href="${ctxf}/userfront/toOrder" >我的订单</a>
						</li>
						<li role="presentation"  class="active">
							<a href="${ctxf}/userfront/toAddress2">收货管理</a>
						</li>
					</ul>	
					<div class="tab-content">
						<div role="tabpanel" class="tab-pane active" id="messages">
							<div class="table-responsive formContent">
								<form class="address_form_list" action="" method="post">
									<!--pc dom start-->
									<table id="data" class="table pc_messages_dom">
										<caption>
											<div class="tab_title col-xs-6">
												地址管理
											</div>
											<div class="col-xs-6 text-right">
												<div class="btn btn-default new_address_model">
													<a href="#">添加新地址</a>
												</div>
											</div>
										</caption>
										<thead>
											<tr>
												<th class="col-xs-3">收件人</th>
												<th class="col-xs-3">详细地址</th>
												<th class="col-xs-3">联系电话</th>
												<th class="col-xs-3">操作</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach items="${addressList}" var="address">
												<tr id="${address.id}">
													<td>${address.addUsername}</td>
													<td>${address.province}${address.city}${address.countyTown}${address.detail}</td>
													<td>${address.addTelnum}</td>
													<td>
														<a href="#" onclick="changeAddress(${address.id});">
															<span>修改</span>
														</a>
														<a href="#">
															<span onclick="delAddress(${address.id})">删除</span>
														</a>
														<a href="${ctxf}/userfront/editDeafultAddress?id=${address.id}">
															<c:if test="${address.defaultAddress==1}">
																<span>默认地址</span>
															</c:if>
															<c:if test="${address.defaultAddress==0}">
																<span>设为默认地址</span>
															</c:if>
														</a>
													</td>
												</tr>
											</c:forEach>
										</tbody>
									</table>
									<!--pc dom end-->

									<!--phone dom start-->
									<div class="phone_address_list">
										<div class="p_new_address text-center">
											<div class="btn btn-default p_new_address_model">添加新地址</div>
										</div>
										<c:forEach items="${addressList}" var="address">
											<div class="p_address_card card" id="${address.id}">
												<div class="card_info">
													<p class="card_user"><span class="card_user_name">${address.addUsername}</span> <span class="card_user_mobile">${user.telNum}</span></p>
													<br />
													<p class="card_detail">${address.province}${address.city}${address.countyTown}${address.detail}</p>
												</div>
												<div class="card_bottom">
													<div class="card_bottom_left">
														<div class="p_address_check check">
															<a href="${ctxf}/userfront/editDeafultAddress?id=${address.id}">
																<c:if test="${address.defaultAddress==1}">
																	<span class="check-text">默认地址</span>
																</c:if>
																<c:if test="${address.defaultAddress==0}">
																	<span class="check-text">设为默认地址</span>
																</c:if>
															</a>
														</div>
													</div>
													<div class="card_bottom_right">
														<div class="p_address_operate operate">
															<div class="operate_item">
																<span class="operate_item_text" onclick="phoneChangeAddress(${address.id});">修改</span>
															</div>
															<div class="operate_item">
																<a href="#">
																	<span class="operate_item_text" onclick="delAddress(${address.id})">删除</span>
																</a>
															</div>
														</div>
													</div>
												</div>
											</div>
										</c:forEach>
									</div>
									<!--phone dom end-->
								</form>
								<!--phone add new  address start-->
								<div class="p_add_address">
									<form id="phone" class="" action="${ctxf}/userfront/saveAddress" method="post">
										<input type="hidden" name="accountInfo.id" value="${user.id}" />
										<input type="hidden" name="id" id="addIdPhone" />
										<div class="row form-group">
											<div class="col-xs-12 control-label">
												<label for="title">收货人</label>
											</div>
											<div class="col-xs-12">
												<input type="text" id="p_consignee" name="addUsername" class="form-control addUsername" placeholder="收货人" autofocus value="">
											</div>
										</div>
										<div class="row form-group">
											<div class="col-xs-12 control-label">
												<label for="title">联系电话</label>
											</div>
											<div class="col-xs-12">
												<input type="text" id="p_contact_phone" name="addTelnum" class="form-control p_contact_phone" placeholder="联系电话" autofocus value="">
											</div>
										</div>

										<div class="row form-group">
											<div class="col-xs-12 col-lg-12 control-label">
												<div class="row">
													<div class="col-xs-4">
														<label for="title">请选择省份</label>
													</div>
													<div class="col-xs-8">
														<select name="loc_province2" id="loc_province2" onchange="getPrivePhone()">
														</select>
														<input style="visibility: hidden;" name="province" id="province2"/>
													</div>

												</div>
											</div>
										</div>
										<div class="row form-group">
											<div class="col-xs-12 col-lg-12 control-label">
												<div class="row">
													<div class="col-xs-4">
														<label for="title">请选择地区</label>
													</div>
													<div class="col-xs-8">
														<select name="loc_city2" id="loc_city2" onchange="getCityPhone()">
														</select>
														<input style="visibility: hidden;" name="city"  id="city2"/>
													</div>

												</div>
											</div>
										</div>
										<div class="row form-group">
											<div class="col-xs-12 col-lg-12 control-label">
												<div class="row">
													<div class="col-xs-4">
														<label for="title">请选择街道</label>
													</div>
													<div class="col-xs-8">
														<select name="loc_town2" id="loc_town2" onchange="getTownPhone()">
														</select>
														<input style="visibility: hidden;" name="countyTown" id="countyTown2"/>
													</div>

												</div>
											</div>
										</div>
										<div class="row form-group">
											<div class="col-xs-12  control-label">
												<label for="title">详细地址</label>
											</div>
											<div class="col-xs-12">
												<input type="text" id="p_detail" name="detail" class="form-control" placeholder="详细地址" autofocus >
											</div>
										</div>
										<div class="form-group">
											<div class="row">
												<div class="col-xs-12">
													<input type="checkbox" name="defaultAdd" id="p_default" onclick="addressCheck()" />
													设为默认地址
												</div>
											</div>
										</div>
										<div class="row p_add_address_btn">
											<div class="col-xs-12 col-lg-12 form-group">
												<button type="button" class="btn btn-primary" id="buttonNamePhone">保存</button>
												<button type="button" class="btn btn-default" onclick="addressCancel();">取消</button><br>
												<button type="submit" id="submitHiddenPhone" class="btn btn-primary" style="visibility: hidden;">保存</button>
											</div>
										</div>
									</form>
								</div>
								<!--phone add new  address end-->
							</div>
						</div>
					</div>
				</div>
			</div>
		</section>
		<!--pc content end-->

		<!--footer start-->
		<%@ include file="/WEB-INF/views/modules/marketFooter.jsp"%>

		<!--footer end-->

	</body>
	<script src="${ctxStatic}/jq-address/js/select2.js" type="text/javascript" charset="utf-8"></script>
	<script src="${ctxStatic}/jq-address/js/location.js" type="text/javascript" charset="utf-8"></script>
	<script src="${ctxStatic}/jq-address/js/area.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(function() {
			$('#myModal').modal({
				backdrop: 'static',
				keyboard: false,
				show: false
			});
			
			//Modal验证销毁重构
		    $('#myModal').on('hidden.bs.modal', function() {
		        $("#df").data('bootstrapValidator').destroy();
		        $('#df').data('bootstrapValidator', null);
		        formValidator();
		        
		    });
     
			$('#example').tooltip('show');
			//表单验证
			formValidator();
			
			//pc端提交按钮
			$("#buttonName").on("click", function(){
			 	var length = $('#data tbody tr').length;
			 	var domArry = $('#data tbody tr');
			 	var submitAddressId = $("#addId").val();
			 	var changeSubmit = false;
			 	var domArryId = [];
			 	domArry.each(function(index,item){
			 		domArryId.push(item.id);
		 	    });
			 	if($("#defaultAdd1").is(':checked')){
					$("#ress").val("false");
				}
			 	for(index in domArryId){
			 		if(domArryId[index] ==  submitAddressId){
			 			changeSubmit = true;
			 		}
			 	}
				if(length >= 10){
					if(changeSubmit){
						//获取表单对象
				    	var bootstrapValidator = $('#df').data('bootstrapValidator');
				        bootstrapValidator.validate();
				        if(bootstrapValidator.isValid()){
				        	$('#submitHidden').removeAttr('disabled');
				            $('#submitHidden').click()
				        }
					}else{
						$('#myModal').modal("hide");
						layer.open({title: '提示', content: '最多只能添加10个地址，请删除旧地址重新添加', icon: 0});
					}
				}else{
			     	//获取表单对象
			    	var bootstrapValidator = $('#df').data('bootstrapValidator');
			        bootstrapValidator.validate();
			        if(bootstrapValidator.isValid()){
			        	$('#submitHidden').removeAttr('disabled');
			            $('#submitHidden').click()
			        }
			       
				}
			});
			/* 手机端 */
			formValidatorPhone();
			
			//手机端提交按钮
			$("#buttonNamePhone").on("click", function(){
			 	var length = $('.p_address_card').length;
			 	var domArry = $('.p_address_card');
			 	var submitAddressId = $("#addId").val();
			 	var changeSubmit = false;
			 	var domArryId = [];
			 	domArry.each(function(index,item){
			 		domArryId.push(item.id);
		 	    });
			 	for(index in domArryId){
			 		if(domArryId[index] ==  submitAddressId){
			 			changeSubmit = true;
			 		}
			 	}
			 	if($("#defaultAdd1").is(':checked')){
					$("#ress").val("false");
				}
				if(length >= 10){
					if(changeSubmit){
						//获取表单对象
				    	var bootstrapValidator = $('#phone').data('bootstrapValidator');
				        bootstrapValidator.validate();
				        if(bootstrapValidator.isValid()){
				        	$('#submitHiddenPhone').removeAttr('disabled');
				            $('#submitHiddenPhone').click()
				        }
					}else{
						addressCancel();
						layer.open({title: '提示', content: '最多只能添加10个地址，请删除旧地址重新添加', icon: 0});
					}
				}else{
			     	//获取表单对象
			    	var bootstrapValidator = $('#phone').data('bootstrapValidator');
			        bootstrapValidator.validate();
			        if(bootstrapValidator.isValid()){
			        	$('#submitHiddenPhone').removeAttr('disabled');
			            $('#submitHiddenPhone').click()
			        }
			       
				}
			});
		})
		
		/* pc 添加地址 change 事件 开始 */
		function getPrive(){
			if($('#select2-chosen-1').html() != "省份"){
				$('#province').val($('#select2-chosen-1').html());
				$('#df').data('bootstrapValidator').updateStatus('province','NOT_VALIDATED',null).validateField('province');
			}else{
				$('#province').val("");
				$('#df').data('bootstrapValidator').updateStatus('province','NOT_VALIDATED',null).validateField('province');
			}
		}
		function getCity(){
			if($('#select2-chosen-2').html() != "地级市"){
				$('#city').val($('#select2-chosen-2').html());
				$('#df').data('bootstrapValidator').updateStatus('city','NOT_VALIDATED',null).validateField('city');
			}else{
				$('#city').val("");
				$('#df').data('bootstrapValidator').updateStatus('city','NOT_VALIDATED',null).validateField('city');
			}
		}
		function getTown(){
			if($('#select2-chosen-3').html() != "市、县、区"){
				$('#countyTown').val($('#select2-chosen-3').html());
				$('#df').data('bootstrapValidator').updateStatus('countyTown','NOT_VALIDATED',null).validateField('countyTown');
			}else{
				$('#countyTown').val("");
				$('#df').data('bootstrapValidator').updateStatus('countyTown','NOT_VALIDATED',null).validateField('countyTown');
			}
		}
		/* pc 添加地址 change 事件结束*/
		
		/* 移动端添加地址 change 事件 开始 */
		function getPrivePhone(){
			
			if($('#select2-chosen-4').html() != "省份"){
				$('#province2').val($('#select2-chosen-4').html());
				$('#phone').data('bootstrapValidator').updateStatus('province','NOT_VALIDATED',null).validateField('province');
			}else{
				$('#province2').val("");
				$('#phone').data('bootstrapValidator').updateStatus('province','NOT_VALIDATED',null).validateField('province');
			}
		}
		function getCityPhone(){
			if($('#select2-chosen-5').html() != "地级市"){
				$('#city2').val($('#select2-chosen-5').html());
				$('#phone').data('bootstrapValidator').updateStatus('city','NOT_VALIDATED',null).validateField('city');
			}else{
				$('#city2').val("");
				$('#phone').data('bootstrapValidator').updateStatus('city','NOT_VALIDATED',null).validateField('city');
			}
		}
		function getTownPhone(){
			if($('#select2-chosen-6').html() != "市、县、区"){
				$('#countyTown2').val($('#select2-chosen-6').html());
				$('#phone').data('bootstrapValidator').updateStatus('countyTown','NOT_VALIDATED',null).validateField('countyTown');
			}else{
				$('#countyTown2').val("");
				$('#phone').data('bootstrapValidator').updateStatus('countyTown','NOT_VALIDATED',null).validateField('countyTown');
			}
		}
		/* 移动端添加地址 change 事件 结束 */
		
		
		function addressCheck(){
			$("#ress").val("false");
		}
		/* 移动端点击     添加地址  */
		$('.p_new_address_model').click(function() {
			$('.address_form_list').css({"display":"none"});
			$(".p_add_address").css({"display":"block"});
			$(".p_add_address input[type~=text]").val('');
			$(".p_add_address .select2-chosen").text('')
		});
		
		/* 移动端点击     取消添加地址  */
		function addressCancel(){
			$("#phone").data('bootstrapValidator').destroy();
		    $('#phone').data('bootstrapValidator', null);
			formValidatorPhone();
			$('.address_form_list').css({"display":"block"});
			$(".p_add_address").css({"display":"none"});
		}
		
		$('.new_address_model').click(function() {
			$('#myModal').modal("show");
			$("#myModal input[type~=text]").val('');
      		$("#myModal .select2-chosen").text('')
		})
		
		/*pc端  修改地址事件 */
		function changeAddress(addressId){
			
			$('#myModal').modal("show");
			
			$.ajax({
				type: "POST",
				url: "${ctxf}/userfront/getAddress?id="+addressId,
				dataType: "json",
				async: true,
				beforeSend: function(XHR) {
					
				},
				success: function(data) {
					$("#addId").val(data.id);
					$('#province').val(data.province);
					$('#countyTown').val(data.countyTown)
					$('#city').val(data.city);
					$("#detail").val(data.detail);
					/* $("#p_detail").val(data.detail);
					$("#p_detail").val(data.detail); */
					
					if(data.defaultAddress==1){
						 $("[name = defaultAdd]:checkbox").prop("checked",true);
						//$("#defaultAdd").checked=true;
					}else{
						$("[name = defaultAdd]:checkbox").prop("checked",false);
					}
					
					$("#pc_consignee").val(data.addUsername);
					$("#pc_contact_phone").val(data.addTelnum);
					$("#select2-chosen-1").html(data.province);
					$("#select2-chosen-2").html(data.city);
					$("#select2-chosen-3").html(data.countyTown);
					
				}
			});
		}
		
		/*phone端  修改地址事件 */
		function phoneChangeAddress(addressId){
			
			$('.address_form_list').css({"display":"none"});
			$(".p_add_address").css({"display":"block"});
			
			$.ajax({
				type: "POST",
				url: "${ctxf}/userfront/getAddress?id="+addressId,
				dataType: "json",
				async: true,
				beforeSend: function(XHR) {
					
				},
				success: function(data) {
					
					$("#addIdPhone").val(data.id);
					$('#province2').val(data.province);
					$('#countyTown2').val(data.countyTown)
					$('#city2').val(data.city);
					$("#p_detail").val(data.detail);
					$("#p_consignee").val(data.addUsername);
					if(data.defaultAddress==1){
						 $("[name = defaultAdd]:checkbox").prop("checked",true);
						//$("#defaultAdd").checked=true;
					}else{
						$("[name = defaultAdd]:checkbox").prop("checked",false);
					}
					
					$("#p_contact_phone").val(data.addTelnum);
					$("#select2-chosen-4").html(data.province);
					$("#select2-chosen-5").html(data.city);
					$("#select2-chosen-6").html(data.countyTown);
				}
			});
		}
		
		/* 删除地址 */
		function delAddress(id){
			layer.confirm('确定删除？', {
				icon: 0,
				title: '提示',
				btn: ['确定', '取消'] //按钮
			}, function() {
				$.ajax({
					type: "POST",
					url: "${ctxf}/userfront/delAddress?id="+id,
					dataType: "json",
					async:true,
					success: function(data) {}
				});
				layer.msg('已删除！', {icon: 1});
				setTimeout(function(){
					window.location.reload();
				},500)
			}, function() {
				
			});
		}
		function formValidator(){
			$('#df').bootstrapValidator({
				 message: 'This value is not valid',
			        feedbackIcons: {
			            valid: '',
			            invalid: '',
			            validating: ''
			        },
			        fields: {
			            'addTelnum': {
			                validators: {
			                	notEmpty: {
			                        message: '请填写联系电话'
			                   },
			                   /*regexp: {
			                        regexp: /^((0\d{2,3}-{0,1}\d{7,8})|(1[35784]\d{9}))$/,
			                        message: '请输入正确的联系电话'
			                    }*/
			                }
			            },
				        'addUsername': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请填写收货人'
			                    }
			                }
			            },
			            'province': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择省份'
			                    }
			                }
			            },
			            'city': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择城市'
			                    },
			                }
			            },
			            'countyTown': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择地区街道'
			                    }
			                }
			            },
			            'detail': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择详细地址'
			                    }
			                }
			            },
			        } 
				})
			};
			function formValidatorPhone(){
				$('#phone').bootstrapValidator({
					 message: 'This value is not valid',
			        feedbackIcons: {
			            valid: '',
			            invalid: '',
			            validating: ''
			        },
			        fields: {
			            'addTelnum': {
			                validators: {
			                	notEmpty: {
			                        message: '请填写联系电话'
			                   },
			                   /*regexp: {
			                        regexp: /^((0\d{2,3}-{0,1}\d{7,8})|(1[35784]\d{9}))$/,
			                        message: '请输入正确的联系电话'
			                    }*/
			                }
			            },
				        'addUsername': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请填写收货人'
			                    }
			                }
			            },
			            'province': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择省份'
			                    }
			                }
			            },
			            'city': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择城市'
			                    },
			                }
			            },
			            'countyTown': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择地区街道'
			                    }
			                }
			            },
			            'detail': {
			                message: '',
			                validators: {
			                    notEmpty: {
			                        message: '请选择详细地址'
			                    }
			                }
			            },
			        }
				})
			}
	</script>

</html>